package ruler.rules;

import java.util.HashMap;

import android.os.Parcel;
import android.os.Parcelable;

public class andRule extends composedRule {

	public andRule(){}	
	public andRule(String n, Rule a, Rule b){
		super(n, a, b);
	}	
	
	public andRule(int id, String name, String description,
			DEVICE_TYPE device_type, RULE_TYPE rule_type, String packageName,
			boolean whenRunning, boolean enable_device, Rule a, Rule b) {
		super(id, name, description, device_type, rule_type, packageName, whenRunning, enable_device, a, b);
	}
	
	
	public boolean isValid(HashMap<String, RULE_TYPE> hasMap) {
		return ((this.r1.isValid(hasMap)) && (this.r2.isValid(hasMap)));
	}
	
	public andRule(Parcel in) {
		super(in);
	}
	
	public static final Parcelable.Creator<andRule> CREATOR = new Parcelable.Creator<andRule>() {
		public andRule createFromParcel(Parcel in) {
			return new andRule(in);
		}
		public andRule[] newArray(int size) {
			return new andRule[size];
		}
	};
	
}
